<form action="${ctx}/platManager/menuAuthority" method="post" enctype="multipart/form-data" id="authorityForm">
	<input type="hidden" name="id" value="${id!}" />
	<!--<table border="1" cellspacing="0" width="80%" >
	<#list firstLevelMenuList as menu>
		<div class="form-group form-inline row">
			<div class="col-sm-12">
				<tr><td rowspan=secondLevelMenuMap["${menu.menuId}"]?size><label>${menu.menuName}：</label></td>
				<#if (secondLevelMenuMap["${menu.menuId}"]??) && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
					<#list secondLevelMenuMap["${menu.menuId}"] as childMenu>
						<td rowspan=thirdLevelMenuMap["${childMenu.menuId}"]?size>
						<#if authorityMenuIdSet?seq_contains(childMenu.menuId)>
							<label><input type="checkbox" class="minimal" name="menuId" value="${childMenu.menuId}" checked>&nbsp;&nbsp;${childMenu.menuName}</label>
						<#else>
							<label><input type="checkbox" class="minimal" name="menuId" value="${childMenu.menuId}">&nbsp;&nbsp;${childMenu.menuName}</label>
						</#if></td>
						<#if (thirdLevelMenuMap["${childMenu.menuId}"]??) && (thirdLevelMenuMap["${childMenu.menuId}"]?size>0)>
							<td><#list thirdLevelMenuMap["${childMenu.menuId}"] as thirdMenu>
								<#if authorityMenuIdSet?seq_contains(thirdMenu.menuId)>
								<label><input type="checkbox" class="minimal" name="menuId" value="${thirdMenu.menuId}" checked>&nbsp;&nbsp;${thirdMenu.menuName}</label>
								<#else>
								<label><input type="checkbox" class="minimal" name="menuId" value="${thirdMenu.menuId}">&nbsp;&nbsp;${thirdMenu.menuName}</label>
								</#if>
							</#list></td>
						</#if>
					</#list>
				</#if>
				</tr>
			</div>
		</div>
	</#list>
	</table>-->

	<table>
		<tr align="conter">
			<th width="20%">一级菜单</th>
			<th width="20%">二级菜单</th>
			<th width="60%">三级菜单</th>
		</tr>
		<#list firstLevelMenuList as menu>
			<tr>
				<#if secondLevelMenuMap["${menu.menuId}"]?? && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
					<#assign secondLevelMenuList=secondLevelMenuMap["${menu.menuId}"]/>
					<td rowspan="${secondLevelMenuList?size +1}">
						<#if authorityMenuIdSet?seq_contains(menu.menuId)>
						<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}" checked>&nbsp;&nbsp;${menu.menuName}
						<#else>
						<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}">&nbsp;&nbsp;${menu.menuName}
					</#if></td>
				<#else>
					<td><#if authorityMenuIdSet?seq_contains(menu.menuId)>
						<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}" checked>&nbsp;&nbsp;${menu.menuName}
						<#else>
						<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}">&nbsp;&nbsp;${menu.menuName}
					</#if></td>
					<td></td>
					<td></td>
				</#if>
			</tr>
			<#if secondLevelMenuMap["${menu.menuId}"]?? && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
				<#list secondLevelMenuMap["${menu.menuId}"] as secondMenu>
					<tr>
						<td><#if authorityMenuIdSet?seq_contains(secondMenu.menuId)>
							<input type="checkbox" class="minimal" p="${menu.menuId}" name="menuId" value="${secondMenu.menuId}" checked>&nbsp;&nbsp;${secondMenu.menuName}
							<#else>
							<input type="checkbox" class="minimal" p="${menu.menuId}" name="menuId" value="${secondMenu.menuId}">&nbsp;&nbsp;${secondMenu.menuName}
						</#if></td>
						<td>
							<#if (thirdLevelMenuMap["${secondMenu.menuId}"]??) && (thirdLevelMenuMap["${secondMenu.menuId}"]?size>0)>
								<#list thirdLevelMenuMap["${secondMenu.menuId}"] as thirdMenu>
									<#if authorityMenuIdSet?seq_contains(thirdMenu.menuId)>
									<input type="checkbox" class="minimal" p="${menu.menuId},${secondMenu.menuId}" name="menuId" value="${thirdMenu.menuId}" checked>&nbsp;&nbsp;${thirdMenu.menuName}
									<#else>
									<input type="checkbox" class="minimal" p="${menu.menuId},${secondMenu.menuId}" name="menuId" value="${thirdMenu.menuId}">&nbsp;&nbsp;${thirdMenu.menuName}
									</#if>
								</#list>
							</#if>
						</td>
					</tr>
				</#list>
			</#if>
		</#list>
	</table>
</form>
<script>
    $(function () {
        $('input[type="checkbox"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue'
        });
    })
	$(function () {
		$('input[name="menuId"]').click(function(){
		  if($(this).is(":checked")){
			  var str = $(this).attr("p");
			  if(str){
				  var arr = str.split(",");
				  $.each(arr,function(i,item){
					  if(item){
						  console.log(item);
						  $('input[type="checkbox"][value="'+item+'"]').attr("checked",true);
					  }
				  });
			  }
		  }else{
			  $(this).removeAttr("checked");
		  }
		});
	})
</script>
<style>
	table tr th, table tr td { border:1px solid #b9cdff;padding-left:20px;padding-right:20px;}
	table { width: 100%; min-height: 25px; line-height: 25px; padding:0px 17px;}
	/*.checkbox-custom {
		position: relative;
		padding: 0 15px 0 25px;
		margin-bottom: 7px;
		margin-top: 0;
		display: inline-block;
	}
	.checkbox-custom input[type="checkbox"]{
		opacity:0;
		position:absolute;
		cursor:pointer;
		z-index:2;
		margin:-6px 0 0 0;
		top:50%;
		left: 3px;
	}
	.checkbox-custom label:before{
		content:'';
		position:absolute;
		top:50%;
		left:0;
		margin-top:-9px;
		width: 19px;
		height: 18px;
		display: inline-block;
		border-radius:2px;
		border:1px solid #bbb;
		backgroud:#fff;
	}
	.checkbox-custom input[type="checkbox"]:checked +label:after{
		position:absolute;
		display: inline-block;
		font-family: 'Glyphicons Halflings';
		content:"\e013";
		top: 42%;
		left: 3px;
		margin-top: -5px;
		font-size: 11px;
		line-height: 1;
		width: 16px;
		height: 16px;
		color: #333;
	}
	.checkbox-custom label{
		cursor: pointer;
		line-height: 1.2;
		font-weight: normal;
		margin-bottom: 0;
		text-align:left;
	}*/
</style>